package com.zpark.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: ConsumerNacosController
 * @Description:
 * @author: RZS
 * @date: 2024/4/23  11:46
 */
@RestController
@RequestMapping("/consumer")
public class ConsumerNacosController {

    @Autowired
    private RestTemplate restTemplate;

    @Value("${service.provider-url}")
    private String uri;

    @GetMapping("/test")
    public String testConsumer(){
        return restTemplate.getForObject(uri + "test", String.class);
    }
}
